package cn.islu.service.impl;

import cn.islu.bean.TbMusic;
import cn.islu.bean.TbSheet;
import cn.islu.dao.TbSheetDao;
import cn.islu.service.TbSheetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TbSheetServiceImpl implements TbSheetService {
    @Autowired
    private TbSheetDao tbSheetDao;

    @Override
    public List<TbSheet> findAll() {
        return tbSheetDao.findAll();
    }

    @Override
    public boolean insertSheet(String sheetName) {
        int affectedRows = tbSheetDao.insertSheet(sheetName);
        if (affectedRows>0){
            return true;
        }
        return false;
    }

    @Override
    public List<TbMusic> findSongsBySheet(String sheetName) {
        return tbSheetDao.findSongsBySheet(sheetName);
    }

}
